package com.xxx.springboot.pojo.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 1. easy poi excel导入类
 *
 * @author guwq
 * @since 2021/6/26
 */
@Data
public class UserImportVO implements IExcelModel, IExcelDataModel, Serializable {

    @NotBlank
    @Excel(name = "姓名")
    private String name;

    @Excel(name = "性别", replace = {"男_1", "女_2"})
    private Integer sex;

    @Excel(name = "出生日期", format = "yyyy-MM-dd")
    private Date birthDay;

    @Length(min = 11, max = 11, message = "请填写正确的手机号码")
    @Excel(name = "手机号码")
    private String phone;

    @Email(message = "请填写正确的邮箱地址")
    @Excel(name = "邮箱")
    private String email;

    @Excel(name = "信息")
    private String errorMsg;

    private Integer rowNum;

    @Override
    public Integer getRowNum() {
        return this.rowNum;
    }

    @Override
    public void setRowNum(Integer rowNum) {
        this.rowNum = rowNum;
    }

    @Override
    public String getErrorMsg() {
        return this.errorMsg;
    }

    @Override
    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
